<?php
	include "layout.php";
	
	head("Delete Deposit");
?>
<?php
	if (!isset($_GET["id"])) {
		header("Location: planets.php");
	}
	if (isset($_POST["submit"])) {
		delete_deposit();
	}
	$id = $_GET["id"];
	$depositq = mysql_query("SELECT * FROM deposits where id={$id}");
	$deposit = mysql_fetch_array($depositq);
	$size = $deposit["value"];
	$rmtypes = $deposit["rmtype"];
	$planets = $deposit["planet"];
	$terrains = $deposit["terrain"];
	$x = $deposit["x"];
	$y = $deposit["y"];
	$rmtypeq = mysql_query("SELECT * FROM rmtypes where id = {$rmtypes}");
	$rmtype = mysql_fetch_array($rmtypeq);
	$planetq = mysql_query("SELECT * FROM planets where id = {$planets}");
	$planet = mysql_fetch_array($planetq);
	$terrainq = mysql_query("SELECT * FROM terrain where id = {$terrains}");
	$terrain = mysql_fetch_array($terrainq);
?>
<h1>Deposit Deletion</h1>
<form action="deletedeposit.php?id=<?php echo $id; ?>" method="post">
	<h3>Are you sure you want to delete this deposit?</h3>
	Deposit ID: <?php echo $id; ?><br />
	Deposit Size: <?php echo $size; ?><br />
	Deposit Type: <?php echo $rmtype["name"]; ?><br />
	Planet: <?php echo $planet["name"]; ?><br />
	Terrain: <?php echo $terrain["name"]; ?><br />
	Coordinate: <?php echo $x; ?>,<?php echo $y; ?><br />
	<input type="submit" value="Yes" name="submit" class="confirm" /><input type="submit" value="No" name="deny" class="confirm" formaction="deposits.php" />
</form>
<?php 
	foot();
?>